/*
 * @Descripttion: 中心接口
 * @version:
 * @Author: 穆宏宇
 * @Date: 2020-09-22 18:38:07
 * @LastEditors: 穆宏宇
 * @LastEditTime: 2020-11-24 13:47:59
 */
import api from './index'
import tools from '@/tools'
import config from "@/config"

// 导入工具函数
// import tools from '@/tools'
// 用户ID
// const id = tools.localRead('userId')

// 查询用户信息 重复
// export const getUser = (id) => {
//   const url = `/api/user/${id}`
//   return api.get(url)
// }

// 根据id查询用户信息
export const getUserById = (id) => {
	const url = `/api/user/${id}`
	return api.get(url)
}

// 获取已注册的采购人
export const getPurchaser = (id) => {
	const url = `/api/user/purchaser/${id}`
	return api.get(url)
}

// 注册采购人
export const registerPurchaser = (form, Uuid, id) => {
	const url = `/api/user/purchaser/${id}`
	const data = {
		...form
	}
	return api.post(url, data, true, Uuid)
}

// 获取组织机构树型数据
export const getPurchaserOrgAll = () => {
	const url = '/api/org/purchaserOrg/all'
	return api.get(url)
}
// 查询供应商组织
export const searchSupplierOrg = (data) => {
	const url = `/special/dictionary/org/selectOrgname`
	return api.post(url,data)
}

// 查询用户所在供应商组织
export const gethSupplierByUser = (id) => {
	const url = `/api/org/supplier/con?userId=${id}`
	return api.get(url)
}

// 查询已拒绝供应商信息
export const selectRefuseTSupplierList = (data) => {
	const url = `/special/dictionary/users/selectRefuseTSupplierList`
	return api.post(url,data)
}

// 注册供应商
export const regSupplier = (data) => {
	const url = `/special/dictionary/users/insertTSupplier`
	return api.post(url, data)
}

// 查询供应商是否注册过
export const searchSupplierRegistered = (id) => {
	const url = `/api/org/authUserOrg/con?userId=${id}`
	return api.get(url)
}

// 查询组织注册信息
export const searchSupplierRegisteredInfor = (orgId) => {
	const url = `/api/org/supplier/${orgId}`
	return api.get(url)
}

// 加入供应商
export const joinSupplier = (data) => {
	const url = '/api/org/supplier/join'
	return api.post(url, data)
}

// 查询组织机构树型结构
export const getOrgTree = (parentId) => {
	const url = `/api/org/tree/${parentId}`
	return api.get(url)
}

// 查询组织机子节点数据
export const getOrgTreeLazy = (parentId) => {
	const url = `/api/org/treeLazy/${parentId}`
	return api.get(url)
}

// 查询已注册采购人
export const getPurchaserList = (userType, params) => {
	const url = `/api/user/${userType === '0' ? 'purchaser' : 'supplier'}/page`
	return api.get(url, params)
}

// 查询权限内的角色
export const getRoleAll = () => {
	const url = '/api/role/all'
	return api.get(url)
}

// 获取角色选项
export const getRoleTemplate = () => {
	const url = '/api/role/template'
	return api.get(url)
}

// 获取角色拥有的权限
export const getRoleTemplateBatch = (data) => {
	const url = '/api/role/template/batch'
	return api.post(url, data)
}
// 查询角色列表
export const getRoleCon = (data) => {
	const url = '/special/dictionary/roleSet/selectRole?pageNum='+data.pageNum+'&pageSize='+data.pageSize
	return api.post(url, data)
}

// 复合条件查询列表用户列表
export const getUserList = (params) => {
	const url = '/api/user/con'
	return api.get(url, params)
}

//根据部门ID获取审批人员列表
export const selectTSysUserListByOrgid = (data) => {
	const url = '/vapi/activity/commensys/selectTSysUserListByOrgid'
	return api.get(url)
}

//根据人员ID获取人员信息
export const selectTSysUserListByAccount = (data) => {
	const url = '/vapi/activity/commensys/selectTSysUserListByAccount/' + data.Account
	return api.get(url)
}

// 更新用户
export const putUser = (data, id) => {
	const url = `/api/user/${id}`
	return api.put(url, data)
}

// 删除用户
export const deleteUser = (userId) => {
	const url = `/api/user/${userId}`
	return api.delete(url)
}

// 角色添加用户
export const roleAdduser = (data) => {
	const url = '/api/role/user/batch'
	return api.post(url, data)
}
// 用户添加角色
export const userAddRole = (data) => {
	const url = '/special/dictionary/users/updateUserRole'
	return api.post(url, data)
}

// 查询采购人组织
export const getpurchaserOrg = (userType) => {
	const url = `/api/org/${userType === '0' ? 'purchaserOrg' : 'supplier'}/all`
	return api.get(url)
}

// 批准采购人|供应商申请
export const approveReg = (userType, id) => {
	const url = `/api/${userType === '0' ? 'user/purchaser' : 'org/supplier'}/approved/${id}`
	return api.post(url)
}

// 供应商审批通过
export const updateTbizSupplier = (data) => {
	const url = `/special/dictionary/users/updateTbizSupplier`
	return api.post(url,data)
}

// 拒绝采购人|供应商申请
export const refuseReg = (userType, id) => {
	const url = `/api/${userType === '0' ? 'user/purchaser' : 'org/supplier'}/approved/${id}`
	return api.delete(url)
}

// 添加|更新组织
export const createOrg = (data) => {
	const url = '/api/org/'
	return api.put(url, data)
}

// 删除组织
export const deleteOrg = (id) => {
	const url = `/api/org/${id} `
	return api.delete(url)
}

// 插入新角色
export const insertRole = (data) => {
	const url = '/special/dictionary/roleSet/insertRole'
	return api.post(url, data)
}

// 编辑角色
export const editorRole = (data, id) => {
	const url = `/special/dictionary/roleSet/updateRole`
	return api.post(url, data)
}

// 删除角色
export const deleteRole = (data) => {
	const url = `/special/dictionary/roleSet/deleteRole`
	return api.post(url,data)
}

// 查询角色下的用户
export const deleteRoleIdDownUsers = (roleId, userId) => {
	const url = `/api/role/user/${roleId}/${userId}`
	return api.delete(url)
}

// 查询售后订单列表
export const getAfterSaleList = (params) => {
	const url = '/api/order/afterSale/center/list'
	return api.get(url, params)
}

// 中心编辑售后订单状态
export const centerAudit = (data) => {
	const url = '/api/order/afterSale/center/update'
	return api.put(url, data)
}

// 查询售后订单列表
export const getSupplierAfterSaleList = (params) => {
	const url = '/api/order/afterSale/supplier/list'
	return api.get(url, params)
}

// 供应商编辑售后订单状态
export const supplierAudit = (data) => {
	const url = '/api/order/afterSale/supplier/update'
	return api.post(url, data)
}

// 角色授权菜单
export const getResourceList = () => {
	const url = '/api/resource/'
	return api.get(url)
}
// 查询用户授权列表
export const getAuthorityResourceList = (id) => {
	const url = `/api/resource/authority/${id}`
	return api.get(url)
}

// 获取角色下的资源 /api/role/authority/${roleId}
export const getRoledAuthorityResourceList = (data) => {
	const url = `/special/dictionary/roleSet/selRoleAuthResource`
	// const url = `/api/role/authority/${roleId}`
	return api.post(url,data)
}

// 角色添加授权菜单
export const postAuthorityBatch = (data) => {
	debugger
	const url = '/special/dictionary/roleSet/updateUserRole/'
	return api.post(url, data)
}

// 添加用户授权
export const addResource = (data) => {
	const url = '/api/resource/authority'
	return api.post(url, data)
}

// 删除用户授权
export const deleteResource = (authorityId, data) => {
	const url = `/api/resource/authority/${authorityId}`
	return api.post(url, data)
}

// 更新用户授权
export const putResource = (authorityId, data) => {
	const url = `/api/resource/authority/${authorityId}`
	return api.put(url, data)
}

// 查询所有已通过的供应商
export const getAllSuppliers = () => {
	const url = '/api/org/supplier/con?auditStatus=1'
	return api.get(url)
}

// 根据商城及sku查询商品名称
export const getGoodsItemBysku = (supplierId, sku) => {
	const url = `/api/goodsItem/manage/info?supplierId=${supplierId}&sku=${sku}`
	return api.get(url)
}

// 查询促销价格优惠
export const getPromotionPrice = (data) => {
	const url = '/api/goodsItem/discountPrice/getPromotionPrice'
	return api.get(url, data)
}

// 设置促销优惠
export const setPromotionPrice = (data) => {
	const url = '/api/goodsItem/discountPrice/setPromotionPrice'
	return api.post(url, data)
}

// 修改促销优惠
export const modifyPromotionPrice = (data) => {
	const url = '/api/goodsItem/discountPrice/modifyPromotionPrice'
	return api.post(url, data)
}

// 删除促销优惠
export const delPromotionPrice = (discountIds) => {
	const url = `/api/goodsItem/discountPrice/deleteDiscount/${discountIds}`
	return api.delete(url)
}

// 发布优惠活动
export const discountPriceRelease = (strGuid) => {
	const url = `/api/goodsItem/discountPrice/release?discountIds=${strGuid}`
	return api.post(url)
}

// 发布优惠活动
export const endDiscount = (strGuid) => {
	var data = [{
		goodsId: strGuid,
		sales: 0
	}]
	const url = `/api/goodsItem/discountPrice/endDiscount`
	return api.post(url, data)
}

// 查询团购价格优惠
export const getWholesalePrice = (data) => {
	const url = '/api/goodsItem/discountPrice/getWholesalePrice'
	return api.get(url, data)
}

// 设置团购优惠
export const setWholesalePrice = (data) => {
	const url = '/api/goodsItem/discountPrice/setWholesalePrice'
	return api.post(url, data)
}

// 修改团购优惠
export const modifyWholesalePrice = (data) => {
	const url = '/api/goodsItem/discountPrice/modifyWholesalePrice'
	return api.post(url, data)
}

// 查询阶梯价格优惠
export const getLadderPrice = (data) => {
	const url = '/api/goodsItem/discountPrice/getLadderPrice'
	return api.get(url, data)
}

// 设置阶梯价格
export const setLadderPrice = (data) => {
	const url = '/api/goodsItem/discountPrice/setLadderPrice'
	return api.post(url, data)
}

// 修改阶梯价格
export const modifyLadderPrice = (data) => {
	const url = '/api/goodsItem/discountPrice/modifyLadderPrice'
	return api.post(url, data)
}

// 查看用户信息 重复
// export const getUserInfo = () => {
//   const url = `/api/user/${id}`
//   return api.get(url)
// }

// 退出账户
export const logout = (token) => {
	const url = `/api/blacklist/token/${token}`
	return api.post(url)
}

// 供应商查询商品列表-中心
export const getListForManage = (params) => {
	const url = '/api/goodsItem/manage/listForManage'
	return api.get(url, params)
}

// 违规记录新增or修改-中心
export const saveOrUpdateViolationRecord = (params) => {
	const url = '/api/violationRecord/saveOrUpdateViolationRecord'
	return api.post(url, params)
}
// 查询运费
export const getFreightList = () => {
	const url = '/api/freight/queryFreight'
	return api.get(url)
}

// 设置运费
export const setFreightPrice = (params) => {
	const url = '/api/freight/updateFreight'
	return api.post(url, params)
}

// 获取供应商
export const getSuppliers = () => {
	const url = '/api/bizOrgSupplier/getAllSuppliers'
	return api.get(url)
}

// 删除客服信息
export const deleteCustom = (customID) => {
	const url = `/api/customer/deleteCustom/${customID}`
	return api.delete(url)
}

// 获取客服信息列表
export const getCustomList = (data) => {
	const url = '/api/customer/queryCustom'
	return api.get(url, data)
}

// 新增或修改客服信息
export const updateCustom = (params) => {
	const url = '/api/customer/saveOrUpdateCustom'
	return api.post(url, params)
}

// 删除编码规则
export const deleteCodingRule = (ruleID) => {
	const url = `/api/sysNumberRule/${ruleID}`
	return api.delete(url)
}

// 获取编码规则列表
export const getCodingRuleList = (data) => {
	const url = '/api/sysNumberRule/list'
	return api.get(url, data)
}

// 新增编码规则
export const addCodingRule = (params) => {
	const url = '/api/sysNumberRule/add'
	return api.post(url, params)
}

// 修改编码规则
export const updateCodingRule = (params) => {
	const url = '/api/sysNumberRule/mod'
	return api.put(url, params)
}

// 获取编码类型
export const getNumTypeList = () => {
	const url = '/api/sysNumberRule/getNumTypeList'
	return api.get(url)
}

// 获取采购分支下拉列表
export const getPurchaseBranchList = () => {
	const url = '/api/purchaseBranch/branchKVList'
	return api.get(url)
}

// 根据年份获取节假日
export const getHolidayList = (params) => {
	const url = '/api/holiday/listByYear'
	return api.get(url, params)
}

//  保存设置的节假日
export const saveHolidayList = (params) => {
	const url = '/api/holiday/save'
	return api.post(url, params)
}

// 根据条件获取公告列表
export const getNoticeList = (params) => {
	const url = '/special/dictionary/Test/selectUniteNotice'
	return api.get(url, params)
}

// 新增
export const insertUniteNotice = (params) => {
	const url = '/special/dictionary/Test/insertUniteNotice'
	return api.post(url, params)
}
//修改公告
export const editUniteNotice = (params) => {
	const url = '/special/dictionary/Test/editUniteNotice'
	return api.put(url, params)
}

//删除公告
export const deleteUniteNotice = (id) => {
	const url = '/special/dictionary/Test/deleteUniteNotice/'+id
	return api.delete(url)
}

// 根据条件获取公告列表
export const getPlanList = (params) => {
	const url = '/special/dictionary/tplan/selectPlanNotice'
	return api.get(url, params)
}

// 新增
export const insertPlanNotice = (params) => {
	const url = '/special/dictionary/tplan/insertPlanNotice'
	return api.post(url, params)
}
//修改公告
export const editPlanNotice = (params) => {
	const url = '/special/dictionary/tplan/editPlanNotice'
	return api.put(url, params)
}

//删除公告
export const deletePlanNotice = (id) => {
	const url = '/special/dictionary/tplan/deletePlanNotice/'+id
	return api.delete(url)
}


// 新增采购分支基础数据
export const addPurchaseBranch = (params) => {
	const url = '/api/purchaseBranch/'
	return api.post(url, params)
}

// 修改采购分支基础数据
export const modifyPurchaseBranch = (params) => {
	const url = '/api/purchaseBranch/'
	return api.put(url, params)
}

// 新增采购分支基础数据
export const deletePurchaseBranch = (params) => {
	const url = `/api/purchaseBranch/${params}`
	return api.delete(url, params)
}

// 查询采购分支
export const queryPurchaseBranch = () => {
	const url = '/api/purchaseBranch/branchList'
	return api.get(url)
}

// 查询采购分支商品目录
export const queryBranchCategoryList = (branchId) => {
	const url = `/api/purchaseBranch/branchCategoryList/${branchId}`
	return api.get(url)
}

// 修改采购分支选择商品目录
export const editCategoryList = (params) => {
	const url = '/api/purchaseBranch/categoryList'
	return api.post(url, params)
}

// 查询全部供应商
export const querySuppliers = () => {
	const url = 'api/org/supplier/all'
	return api.get(url)
}

// 查询数据字典
export const queryDictionary = (params) => {
	const url = '/api/dictionary/queryList'
	return api.get(url, params)
}

// 修改数据字典
export const editDictionary = (params) => {
	const url = '/api/dictionary/'
	return api.put(url, params)
}

// 查询商品属性列表
export const queryGoodsPropertyList = (categoryId = '', params) => {
	const url = `/api/property/queryList/${categoryId}`
	return api.get(url, params)
}

// 查询所有字段输入类型 （商品/采购 属性）
export const getAllInputType = () => {
	const url = '/api/property/getAllInputType'
	return api.get(url)
}

// 查询所有商品属性取值规则
export const getAllItemRules = () => {
	const url = '/api/itemRule/getAllItemRules'
	return api.get(url)
}

// 修改属性
export const editGoodsProperty = (params) => {
	const url = '/api/property/edit'
	return api.post(url, params)
}

// 添加属性
export const addGoodsProperty = (params) => {
	const url = '/api/property/add'
	return api.post(url, params)
}

// 查询所有商品属性值
export const queryGoodsPropertyValueList = (params) => {
	const url = `/api/propertyValue/queryList/${params}`
	return api.get(url)
}

// 修改属性值
export const editGoodsPropertyValue = (params) => {
	const url = '/api/propertyValue/edit'
	return api.post(url, params)
}

// 添加属性值
export const addGoodsPropertyValue = (params) => {
	const url = '/api/propertyValue/add'
	return api.post(url, params)
}

// 查询生成对账单
export const queryRecordList = (params) => {
	const url = '/api/order/reconciliation/create'
	return api.get(url, params)
}

// 同步对账单
export const syncSupplierBills = (params) => {
	const url = '/api/order/reconciliation/centerSync'
	return api.post(url, params)
}

// 标记为不参与对账
export const signNoCheck = (params) => {
	const url = '/api/order/reconciliation/signNoCheck'
	return api.post(url, params)
}

// 触发对账
export const triggerRecord = (params) => {
	const url = '/api/order/reconciliation/check'
	return api.post(url, params)
}

// 触发对账列表页
export const checkList = (params) => {
	const url = '/api/order/reconciliation/checkList'
	return api.get(url, params)
}

// 触发对账页面标记为不参与对账
export const signNoCheckTriggerRecord = (params) => {
	const url = '/api/order/reconciliation/signNoCheck_'
	return api.post(url, params)
}

// 中心对账结果列表
export const centerRecordResultList = (params) => {
	const url = '/api/order/reconciliation/centerResult'
	return api.get(url, params)
}

// 供应商对账结果列表
export const supplierRecordResultList = (params) => {
	const url = '/api/order/reconciliation/shopResult'
	return api.get(url, params)
}

// 导出中心账单
export const centerDownload = (params) => {
	const url = '/api/order/reconciliation/centerDownload'
	return api.download(url, params)
}

// 导出供应商账单
export const shopResultDownload = (params) => {
	const url = '/api/order/reconciliation/shopResultDownload'
	return api.download(url, params)
}

// 获取开票页面列表
export const queryInvoiceList = (params) => {
	const url = '/api/invoice/queryReconciliationResults'
	return api.get(url, params)
}

// 导出订单信息
export const exportInvoiceInfo = (params) => {
	let url = '/api/invoice/exportReconciliationResults'
	return api.download(url, params)
}

// 违规记录查询
export const queryViolationRecord = (params) => {
	const url = '/api/violationRecord/queryViolationRecord'
	return api.get(url, params)
}

// 违规记录删除
export const deleteViolationRecord = (id) => {
	const url = `/api/violationRecord/deleteViolationRecord/${id}`
	return api.delete(url)
}

// 查询商品品目树
export const getQueryItemTrees = (params) => {
	const url = '/api/maintenanceAuthority/queryItemTrees'
	return api.get(url, params)
}

// 根据供应商id查询商品品目树
export const getQueryItemTreesBySupplierId = (params) => {
	const url = '/api/maintenanceAuthority/queryItemTreesBySupplierId'
	return api.get(url, params)
}

// 根据供应商ID查询商品库权限
export const getQueryMaintenanceAuthority = (params) => {
	const url = '/api/maintenanceAuthority/queryMaintenanceAuthority'
	return api.get(url, params)
}

// 修改商品库权限状态
export const updateAuthorityStatus = (params) => {
	const url = '/api/maintenanceAuthority/updateAuthorityStatus'
	return api.put(url, params)
}

// 查询供应商
export const getQuerySupplier = (params) => {
	const url = '/api/maintenanceAuthority/querySupplier'
	return api.get(url, params)
}

//内部查询供应商接口
export const getQuerySupplierLocal = (params) => {
	const url = '/vapi/activity/actorg/list'
	return api.get(url, params)
}

// 保存授权
export const insertAuthority = (params) => {
	const url = '/api/maintenanceAuthority/insertAuthority'
	return api.post(url, params)
}

// 委托管理列表信息
export const getDemandList = (params) => {
	const url = '/api/order/demandList'
	return api.get(url, params)
}

// 委托购买商品列表
export const getdetailsByOrderId = (orderId) => {
	const url = `/api/orderDetail/getdetailsByOrderId/${orderId} `
	return api.get(url)
}

// 委托管理详情
export const getOrderDetail = (id) => {
	const url = `/api/order/${id}`
	return api.get(url)
}

// 退回委托
export const returnOrder = (orderId, params) => {
	const url = `/api/order/returnOrder/${orderId}`
	return api.put(url, params)
}

// 创建项目
export const createProProjects = (params) => {
	const url = '/api/tPurchaseProProjects/createProProjects'
	return api.post(url, params)
}

// 委托购买商品列表信息
export const getDetailsByOrderId = (orderId) => {
	const url = `/api/orderDetail/getdetailsByOrderId/${orderId}`
	return api.get(url)
}

// 查询过程记录信息
export const getQueryProProcessCodeList = (ids) => {
	const url = '/api/tPurchaseProcessCode/queryProProcessCodeList'
	return api.get(url, ids)
}

// 查询项目基本信息
export const getProProjectInfo = (id) => {
	const url = `/api/tPurchaseProProjects/getProProjectInfo/${id}`
	return api.get(url)
}

// 查询定标信息
export const getProjectAndPicketageInfo = (params) => {
	const url = '/api/tPurchaseBidPicketage/getProjectAndPicketageInfo'
	return api.get(url, params)
}

// 查询询价规则
export const getBiddingRules = (projectId) => {
	const url = `/api/tPurchaseProProjects/getBiddingRules/${projectId}`
	return api.get(url)
}

// 查询报价列表
export const getBidBiddingPageList = (params) => {
	const url = '/api/tPurchaseBidBidding/bidBiddingPageList'
	return api.get(url, params)
}

// 查询项目列表
export const getProProjectList = (params) => {
	const url = '/api/tPurchaseProProjects/proProjectsPageList'
	return api.get(url, params)
}

// 修改项目时间
export const editProProjectsTime = (params) => {
	const url = '/api/tPurchaseProProjects/'
	return api.put(url, params)
}

// 供应商审核
export const uppliersCertificateAudit = (params) => {
	const url = '/api/purchaseProSuppliersCertificate/audit'
	return api.put(url, params)
}

// 供应商审核
export const getDetailById = (id) => {
	const url = `/api/purchaseProSuppliersCertificate/getDetailById/${id}`
	return api.get(url)
}

// 项目撤销
export const cancelProjects = (params) => {
	const url = '/api/tPurchaseProProjects/cancel'
	return api.put(url, params)
}

// 废标
export const doInvalidBid = (projectsId, params) => {
	const url = `/api/tPurchaseProProjects/doInvalidBid/${projectsId}`
	return api.put(url, params)
}
// 查询上传文件列表
export const queryFileListByType = (fileType) => {
	const url = `/api/file/queryListByType/${fileType}`
	return api.get(url)
}

// 新增和修改平台介绍
export const savePlatformIntroduction = (data) => {
	const url = '/special/dictionary/introduction/edit'
	return api.put(url, data)
}

// 查询平台介绍
export const selectPlatformIntroduction = () => {
	const url = '/special/dictionary/introduction/list'
	return api.get(url)
}

// 查询商品目录异步树
export const queryGodCategoryZtreeAsyn = (parentId, v) => {
	// const url = `/api/category/queryGodCategoryZtreeAsyn?parentId=${parentId}&v=${v}`
	const url = `/vapi/index/system/category/queryGodCategoryZtreeAsyn?parentId=${parentId}&v=${v}`
	return api.get(url)
}

// 设置商品状态(新提交、审核通过、退回...等)
export const setGoodsState = (goodsState, data) => {
	const url = `/api/goodsItem/manage/setGoodsState?goodsState=${goodsState}`
	return api.post(url, data)
}

// 设置是否扶贫
export const setIsAid = (isAid, data) => {
	const url = `/api/goodsItem/manage/setIsAid?isAid=${isAid}`
	return api.post(url, data)
}

// 查询商品详细信息
export const getLocalGoodItemDetail = (id) => {
	const url = `/api/goodsItem/manage/center/supplier?id=${id}`
	return api.get(url)
}

// 查询供应商报名列表
export const getCertificatePageList = (params) => {
	const url = '/api/purchaseProSuppliersCertificate/certificatePageList'
	return api.get(url, params)
}

// 查询日志列表
export const getQuerySelfOperatedPriceLog = (params) => {
	const url = '/api/selfOperatedPriceSetting/querySelfOperatedPriceLog'
	return api.get(url, params)
}

// 批量修改折扣率
export const updateSelfOperatedPrice = (params) => {
	const url = '/api/selfOperatedPriceSetting/updateSelfOperatedPrice'
	return api.put(url, params)
}

// 品目设置树
export const querySelfOperatedPriceTrees = (params) => {
	const url = '/api/selfOperatedPriceSetting/querySelfOperatedPriceTrees'
	return api.get(url, params)
}

// 重置品目价格
export const resetSelfOperatedPrice = () => {
	const url = '/api/selfOperatedPriceSetting/resetSelfOperatedPrice'
	return api.put(url)
}

// 上下架记录
export const shelfHistory = (fkItemId, params) => {
	const url = `/api/itemStateHis/queryList/${fkItemId}`
	return api.get(url, params)
}
// 查询订单管理列表
export const getList = (params) => {
	const url = '/vapi/shoporder/selOrderManagement?pageNum=' + params.pageNum + '&pageSize=' + params.pageSize
	return api.post(url, params)
}
export const getListZhu = (params) => {
	const url = '/vapi/shoporder/selOrderManagementZhu?pageNum=' + params.pageNum + '&pageSize=' + params.pageSize
	return api.post(url, params)
}
// 查询订单管理列表（扶贫）
export const getListfp = (params) => {
	const url = '/vapi/shoporder/selPovertyAlleviation?pageNum=' + params.pageNum + '&pageSize=' + params.pageSize
	return api.post(url, params)
}

// 查询订单管理列表（项目经理）
export const getListmanager = (params) => {
	const url = '/vapi/shoporder/selOrderDetailByPM?pageNum=' + params.pageNum + '&pageSize=' + params.pageSize
	return api.post(url, params)
}


// 查询历史订单管理列表
export const queryHistoryOrderPageList = (params) => {
	const url = '/api/order/queryHistoryOrderPageList'
	return api.get(url, params)
}


// 查询历史订单明细
export const queryHistoryOrderDetail = (params) => {
	const url = '/api/order/queryHistoryOrderDetail'
	return api.get(url, params)
}


// 查询订单管理列表
export const getPurchaseType = (purchaseType) => {
	const url = `/api/purchaseBranch/branchShowList/${purchaseType}`
	return api.get(url)
}



// 导出订单
export const getExport = (params) => {
	let url = '/vapi/shoporder/exportOrderManagement'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.download(url)
}

// 导出订单(项目经理)
export const getExportmanager = (params) => {
	let url = '/vapi/shoporder/exportOrderDetailByPM'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.download(url)
}

// 导出订单(扶贫)
export const getExportfp = (params) => {
	let url = '/vapi/shoporder/exportPovertyAlleviation'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.download(url)
}


// 同步订单状态
export const syncOrderStatus = (params) => {
	const url = '/api/order/supplier/sync'
	return api.get(url, params)
}

// 下单失败列表
export const getQueryList = (params) => {
	const url = '/api/orderInterfaceErr/queryList'
	return api.get(url, params)
}

// 自营价 按商品设置
export const selfPriceList = (params) => {
	const url = '/api/goodsItem/manage/selfPrice/list'
	return api.get(url, params)
}

// 按Id更新自营价浮动率
export const setSelfPriceFloat = (data) => {
	const url = '/api/goodsItem/manage/selfPriceFloat'
	return api.post(url, data)
}

// 查询中心订单详情
export const centrOrderInfor = (data) => {
	// const url = `/api/order/getInfoById/${id}`
	const url = `/vapi/shoporder/getInfoById`
	return api.post(url, data)
}

// 添加品目
export const addItemCategory = (data) => {
	const url = '/api/category/addItemCategory'
	return api.post(url, data)
}

// 修改品目
export const editItemCategory = (data) => {
	const url = '/api/category/editItemCategory'
	return api.post(url, data)
}

// 目录置为无效
export const invalidItemCategory = (data) => {
	// const url = '/api/category/invalidItemCategory'
	const url = `${config.pre}/index/system/category/invalidItemCategory`
	return api.post(url, data)
}

// 保存办公用品和工业用品
export const updateOfficeSupplies = (data) => {
	const url = '/api/nav/updateOfficeSupplies'
	return api.put(url, data)
}

// 查询品牌列表
export const queryList = (params) => {
	const url = '/api/brands/queryList'
	return api.get(url, params)
}

// 修改有效性
export const editV = (data) => {
	const url = '/api/brands/editV'
	return api.post(url, data)
}

// 查询采购人采购属性值列表
export const propertyValuePurchaserList = (id, params) => {
	const url = `/api/propertyValuePurchaser/queryList/${id}`
	return api.get(url, params)
}

// 添加采购人采购属性值
export const propertyValuePurchaserAdd = (data) => {
	const url = '/api/propertyValuePurchaser/add'
	return api.post(url, data)
}

// 修改采购人采购属性值
export const propertyValuePurchaserEdit = (data) => {
	const url = '/api/propertyValuePurchaser/edit'
	return api.post(url, data)
}

// 删除商品属性值
export const deletePropertyValue = (id) => {
	const url = `/api/propertyValue/${id}`
	return api.delete(url)
}

// 删除采购人采购属性值
export const deletePropertyValuePurchaser = (id) => {
	const url = `/api/propertyValuePurchaser/${id}`
	return api.delete(url)
}

// 查询供应商列表-自营价
export const suppliersForSelfOperatedPrice = () => {
	const url = '/api/selfOperatedPriceSetting/suppliersForSelfOperatedPrice'
	return api.get(url)
}

// 查询自营价适用供应商
export const suppliersUseSelfOperatedPrice = () => {
	const url = '/api/selfOperatedPriceSetting/suppliersUseSelfOperatedPrice'
	return api.get(url)
}

// 设置自营价适用供应商
export const setSuppliersUseSelfOperatedPrice = (data) => {
	const url = '/api/selfOperatedPriceSetting/suppliersUseSelfOperatedPrice'
	return api.post(url, data)
}

// 更新商品价格
export const allItemPrice = (data) => {
	const url = '/api/goodsItem/sync/allItemPrice'
	return api.post(url, data)
}

// 重置密码
export const resetPasswordApi = (data) => {
	const url = `/special/dictionary/users/resetPwdByUserId`
	return api.post(url,data)
}

// 添加商品高于官网价
export const allowedSelfExceedOffice = (data) => {
	const url = '/api/selfOperatedPriceSetting/allowedSelfExceedOffice'
	return api.post(url, data)
}

// 移除商品可以高于官网价
export const unAllowedSelfExceedOffice = (data) => {
	const url = '/api/selfOperatedPriceSetting/unAllowedSelfExceedOffice'
	return api.put(url, data)
}

// 电商成交量排名列表
export const queryGoodsStatisticsList = (params) => {
	const url = '/api/statistics/afterSale/queryGoodsStatisticsList'
	return api.get(url, params)
}

// 导出商品类目总量排名
export const exportGoodsStatistics = (params) => {
	const url = '/api/statistics/afterSale/exportGoodsStatistics'
	return api.download(url, params)
}

// 本地供应商成交量列表
export const queryLocalShopDealList = (params) => {
	const url = '/api/statistics/afterSale/queryLocalShopDealList'
	return api.get(url, params)
}

// 电商商成交量列表
export const queryEshopDealList = (params) => {
	const url = '/api/statistics/afterSale/queryEshopDealList'
	return api.get(url, params)
}

// 导出本地供应商成交量
export const exportLocalShopDeal = (params) => {
	const url = '/api/statistics/afterSale/exportLocalShopDeal'
	return api.download(url, params)
}

// 导出电商成交量
export const exportEshopDeal = (params) => {
	const url = '/api/statistics/afterSale/exportEshopDeal'
	return api.download(url, params)
}

// 上次多文件
export const uploadMultipleFiles = (data) => {
	debugger
	const url = '/api/file/uploadList'
	return api.post(url, data)
}


// 商品上下架历史
export const systemHis = (data) => {
	// const url = '/vapi/activity/acthis'
	// return api.post(url,data)
}


//管理员取消订单
export const cancelConfirmOrder = (data) => {
	const url = '/vapi/shoporder/cancellationOfOrder/'
	return api.post(url, data)
}


// 设置折扣率
export const systemRate = (data) => {
	const url = '/vapi/activity/actrate'
	return api.post(url, data)
}
// 修改折扣率
export const putSystemRate = (data) => {
	const url = '/vapi/activity/actrate'
	return api.put(url, data)
}

//查询折扣率
export const rateList = (data) => {
	const url = '/vapi/activity/actrate/list?itemCategoryId=' + data.itemCategoryId + '&supplierId=' + data
		.supplierId
	return api.get(url)
}






//折扣率列表(1级)
export const getGoodsItemInfomationbyfirst = (data) => {
	const url = '/dlzldb/orderDetailItemPriceChange/getGoodsItemInfomationbyfirst'
	return api.post(url, data)
}
//折扣率列表(2级)
export const getGoodsItemInfomationbytwo = (data) => {
	const url = '/dlzldb/orderDetailItemPriceChange/getGoodsItemInfomationbytwo'
	return api.post(url, data)
}
//折扣率列表(3级)
export const getGoodsItemInfomationbythree = (data) => {
	const url = '/dlzldb/orderDetailItemPriceChange/getGoodsItemInfomationbythree'
	return api.post(url, data)
}
//折扣率SKU列表
export const getGoodsItemInfomationbyCategoryIdAndsupplierId = (data) => {
	const url = '/dlzldb/orderDetailItemPriceChange/getGoodsItemInfomationbyCategoryIdAndsupplierId?pageNum=' + data
		.pageNum + '&pageSize=' + data.pageSize
	return api.post(url, data)
}

//上下架预警列表
export const getOrderDetailItemState = (data) => {
	const url = '/dlzldb/orderDetailItemState/getOrderDetailItemState?pageNum=' + data.pageNum + '&pageSize=' + data
		.pageSize
	return api.post(url, data)
}

//上下价比对预警
export const getOrderDetailItemStateByShowId = (data) => {
	const url = '/dlzldb/orderDetailItemState/getOrderDetailItemStateByShowId'
	return api.post(url, data)
}

//预警点列表
export const hisList = (goodsId) => {
	const url = '/vapi/activity/acthis/list?fkItemId=' + goodsId
	return api.get(url)
}

//价格修改预警
export const getOrderDetailItemPriceChange = (data) => {
	const url = '/dlzldb/orderDetailItemPriceChange/getOrderDetailItemPriceChange?pageNum=' + data.pageNum +
		'&pageSize=' + data.pageSize
	return api.post(url, data)
}

//价格对比预警
export const getOrderDetailItemPriceChangeByOrderId = (data) => {
	const url = '/dlzldb/orderDetailItemPriceChange/getOrderDetailItemPriceChangeByOrderId'
	return api.post(url, data)
}

//预警点列表
export const changeList = (data) => {
	const url = '/vapi/activity/actchange/list?fkItemId=' + data.goodsId + '&createTime=' + data.createTime
	return api.get(url)
}

//价格变更导出
export const orderDetailItemPriceChange = () => {
	const url = '/dlzldb/orderDetailItemPriceChange/export'
	return api.get(url)
}

//上下架导出
export const orderDetailItemStateExport = () => {
	const url = '/dlzldb/orderDetailItemState/export'
	return api.get(url)
}

//供应商对账查询列表
export const findOrderSupplierList = (data) => {
	const url = '/vapi/order/findOrderSupplierList?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize
	return api.post(url, data)
}

//供应商提交对账备注
export const setReceivingStatus = (data) => {
	const url = '/vapi/order/setReceivingStatus'
	return api.post(url, data)
}

//项目经理对账查询列表
export const findTOrderManagerList = (data) => {
	const url = '/vapi/reconciliation/reconciliationSupplier/admin/applyListHistory?pageNum=' + data.pageNum +
		'&pageSize=' + data.pageSize
	return api.post(url, data)
}

//采购提交对账备注
export const setStatus = (data) => {
	const url = '/vapi/order/setStatus'
	return api.post(url, data)
}
//通过组织查询对账人员
export const findOrgUserList = (data) => {
	const url = '/vapi/order/findOrgUserList'
	return api.post(url, data)
}
//对账查询人员
export const getUser = (data) => {
	const url = '/vapi/order/getUser'
	return api.post(url, data)
}

//项目经理对账查询列表
export const findTOrderPurchaserList = (data) => {
	const url = '/vapi/order/findTOrderPurchaserList?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize
	return api.post(url, data)
}

//采购提交对账备注
export const setApplyInvoicing = (data) => {
	const url = '/vapi/order/setApplyInvoicing'
	return api.post(url, data)
}

//查询发票信息
export const getTreceipt = (data) => {
	const url = '/vapi/order/getTreceipt'
	return api.post(url, data)
}

//财务发票
export const findTOrderFinanceList = (data) => {
	const url = '/vapi/order/findTOrderFinanceList'
	return api.post(url, data)
}

//导出订单
export const exportOrder = (data) => {
	const url = '/vapi/export/exportOrder'
	return api.post(url, data)
}


//超级供应商对账
export const findOrderSupplierAdminList = (data) => {
	const url = '/vapi/order/findOrderSupplierAdminList?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize
	return api.post(url, data)
}

// 设置超级供应商相关信息
export const setUserSuperintendent = (data) => {
	const url = '/vapi/order/setUserSuperintendent'
	return api.post(url, data)
}

// 设置超级采购组织相关信息
export const findTOrderPurchaserAdminList = (data) => {
	const url = '/vapi/order/findTOrderPurchaserAdminList'
	return api.post(url, data)
}

// 采购组织查询组织树
export const getOrgLazyTree = (data) => {
	const url = '/special/dictionary/org/purchaserOrg/all'
	return api.post(url, data)
}


// 项目经理查询组织树
export const findOrgByMangerList = (data) => {
	const url = '/vapi/order/findOrgByMangerList'
	return api.post(url, data)
}

// 项目经理查询组织树(下级)
export const getOrgLazyTree2 = (data) => {
	const url = '/vapi/order/getOrgLazyTree2'
	return api.post(url, data)
}

// 项目经理对账管理（供应商）
export const findBySupplierManagerOrderList = (data) => {
	const url = '/vapi/order/findBySupplierManagerOrderList'
	return api.post(url, data)
}

// 供应商分账配置
export const findMangerSupplierList = (data) => {
	const url = '/vapi/order/findMangerSupplierList?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize
	return api.post(url, data)
}

//查询项目经理
export const findMangerList = (data) => {
	const url = '/vapi/order/findMangerList'
	return api.post(url, data)
}
//查询供应商
export const findOrgList = (data) => {
	const url = '/vapi/order/findOrgList'
	return api.post(url, data)
}
//修改供应商分账
export const setMangerByUser = (data) => {
	const url = '/vapi/order/setMangerByUser'
	return api.post(url, data)
}

//项目经理分账配置
export const findProjectMangerList = (data) => {
	const url = '/vapi/order/findProjectMangerList?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize
	return api.post(url, data)
}

//修改项目经理分账
export const setMangerByProject = (data) => {
	const url = '/vapi/order/setMangerByProject'
	return api.post(url, data)
}

//allch人员列表
export const getOrgChAll = (data) => {
	const url = '/vapi/order/getOrgChAll'
	return api.post(url, data)
}

//项目经理组织树模糊查询
export const getOrgLazyTree3 = (data) => {
	const url = '/vapi/order/getOrgLazyTree3'
	return api.post(url, data)
}

//供应商组织树模糊查询
export const getOrgLazyTree4 = (data) => {
	const url = '/vapi/order/getOrgLazyTree4'
	return api.post(url, data)
}

//供应商导出订单
export const supplierReconciliationExport = (data) => {
	const url = '/supplierReconciliation/export'
	return api.postDownload(url, data)
}

//项目经理导出订单
export const managerReconciliationExport = (data) => {
	const url = '/managerReconciliation/export'
	return api.postDownload(url, data)
}

//免登
export const oauths = (data) => {
	// const url = '/vapi/sso/oauth'
	const url = '/special/dictionary/users/login'
	return api.post(url, data)
}



//分类新增带图片
export const addCategory = (data) => {
	const url = '/vapi/index/system/category'
	return api.post(url, data)
}
//分类修改带图片
export const editCategory = (data) => {
	const url = `${config.pre}/index/system/category`
	return api.put(url, data)
}

//分类查询带图片
export const categoryList = (parentCategoryId, v) => {
	const url = `${config.pre}/index/system/category/list?parentCategoryId=${parentCategoryId}&v=${v}`
	return api.get(url)
}
export const categoryPcList = (parentCategoryId, v, isDel) => {
	const url = `${config.pre}/index/system/category/pclist?parentCategoryId=${parentCategoryId}&v=${v}&isDel=${isDel}`
	return api.get(url)
}
export const categoryInfo = (id) => {
	const url = `${config.pre}/index/system/category/${id}`
	return api.get(url)
}

//特色专区商品列表（全部）
export const characteristicgoodsAll = (data) => {
	const url = `/vapi/index/characteristicgoods/listall`
	return api.get(url, data)
}

//特色专区商品列表
export const characteristicgoods = (data) => {
	const url = '/vapi/index/characteristicgoods/list'
	return api.get(url, data)
}

//特色专区商品新增
export const characteristicgoodsAdd = (data, characteristicId) => {
	const url = '/vapi/index/characteristicgoods/add/' + characteristicId
	return api.post(url, data)
}


//特色专区商品删除
export const characteristicgoodsDelete = (ids) => {
	const url = '/vapi/index/characteristicgoods/' + ids
	return api.delete(url)
}


//特色专区列表（全部）
export const characteristicareaAll = (data) => {
	const url = `/vapi/index/characteristicarea/listall`
	return api.get(url)
}



//============================优选品类
//优选品类查询
export const excellentList = (parentCategoryId, v) => {
	const url = `/vapi/index/excellent/list?parentCategoryId=${parentCategoryId}`
	return api.get(url)
}
// 优选品类新增
export const addExcellent = (data) => {
	const url = '/vapi/index/excellent'
	return api.post(url, data)

}
//优选品类修改
export const editExcellent = (data) => {
	const url = '/vapi/index/excellent'
	return api.put(url, data)
}
//优选品类删除
export const deleteExcellent = (ids) => {
	const url = '/vapi/index/excellent/' + ids
	return api.delete(url)
}


//============================特色专区
//特色专区查询
export const characteristicareaList = (data) => {
	const url = `/vapi/index/characteristicarea/list`
	return api.get(url, data)
}
// 特色专区新增
export const addCharacteristicarea = (data) => {
	const url = '/vapi/index/characteristicarea'
	return api.post(url, data)
}
//特色专区修改
export const editCharacteristicarea = (data) => {
	const url = '/vapi/index/characteristicarea'
	return api.put(url, data)
}
//特色专区删除
export const deleteCharacteristicarea = (ids) => {
	const url = '/vapi/index/characteristicarea/' + ids
	return api.delete(url)
}



//============================优选品牌
//优选品牌查询
export const brandsList = (data) => {
	const url = `/vapi/index/brands/list`
	return api.get(url, data)
}
// 优选品牌新增
export const addBrands = (data) => {
	const url = '/vapi/index/brands'
	return api.post(url, data)
}
//优选品牌修改
export const editBrands = (data) => {
	const url = '/vapi/index/brands'
	return api.put(url, data)
}
//优选品牌删除
export const deleteBrands = (ids) => {
	const url = '/vapi/index/brands/' + ids
	return api.delete(url)
}







//================================优选商品


//优选商品列表 
export const tqualitygoodsgoodsAll = (data) => {
	const url = `/vapi/index/tqualitygoods/listall`
	return api.get(url, data)
}

//优选商品列表   -----匹配已经有的商品（全部）
export const tqualitygoodsList = (data) => {
	const url = '/vapi/index/tqualitygoods/selectlist'
	return api.get(url, data)
}

//优选商品新增
export const tqualitygoodsAdd = (data) => {
	const url = '/vapi/index/tqualitygoods'
	return api.post(url, data)
}

//优选商品删除
export const tqualitygoodsDelete = (ids) => {
	const url = '/vapi/index/tqualitygoods/' + ids
	return api.delete(url)
}



//=============================防疫物资

//防疫物资列表 
export const fangyilistAll = (data) => {
	const url = `/vapi/index/tqualitygoods/listallfy`
	return api.get(url, data)
}

//防疫物资列表   -----匹配已经有的商品（全部）
export const fangyilist = (data) => {
	const url = '/vapi/index/tqualitygoods/selectlistfy'
	return api.get(url, data)
}

//防疫物资新增
export const fangyiadd = (data) => {
	const url = '/vapi/index/tqualitygoods/addfys'
	return api.post(url, data)
}

//查询下架商品
export const searchByDown = (data) => {
	const url = '/vapi/item/searchByAll'
	return api.post(url, data)
}

//上架商品
export const updateUser = (data) => {
	const url = '/vapi/item/updateUser'
	return api.post(url, data)
}

// 查询所有商品
export const searchAllGoods = (data) => {
	const url = '/vapi/item/search'
	return api.post(url, data)
}


//=============================扶贫物资

//扶贫物资列表 
export const fupinlistAll = (data) => {
	const url = `/vapi/index/tconsumerAssistance/listall`
	return api.get(url, data)
}

//扶贫物资列表   -----匹配已经有的商品（全部）
export const fupinlist = (data) => {
	const url = '/vapi/index/tconsumerAssistance/selectlist'
	return api.get(url, data)
}

//扶贫物资新增
export const fupinadd = (data) => {
	const url = '/vapi/index/tconsumerAssistance'
	return api.post(url, data)
}

//优选商品删除
export const fupindelete = (ids) => {
	const url = '/vapi/index/tconsumerAssistance/' + ids
	return api.delete(url)
}


// 导入excel
export const importInvoiceReconciliation = (data) => {
	const url = '/vapi/excel/import/importInvoiceReconciliation'
	return api.post(url, data)
}


//查询导入excel数据
export const selInvoiceReconciliaion = (data) => {
	const url = '/vapi/excel/import/selInvoiceReconciliaion?pageNum=' + data.pageNum + '&pageSize=' + data
		.pageSize + '&batchNumber=' + data.batchNumber + '&invoiceTaker=' + data.invoiceTaker + '&orderNo=' + data
		.orderNo
	return api.post(url, data)
}


//导出excel文件
export const invoiceReconciliation = (data) => {
	const url = '/vapi/excel/export/exportInvoiceReconciliation'
	return api.download(url, data)
}


//导入excel子查询
export const selInvoiceRecon = (data) => {
	const url = '/vapi/excel/import/selInvoiceRecon?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize
	return api.post(url, data)
}


//导入excel其他查询
export const selInvoiceReconciliation = (data) => {
	const url = '/vapi/excel/export/selInvoiceReconciliation?pageNum=' + data.pageNum + '&pageSize=' + data
		.pageSize + '&orderNo=' + data.orderNo + '&invoiceTaker=' + data.invoiceTaker + '&managerName1=' + data
		.managerName1 + '&sku=' + data.sku + '&createTime=' + data.createTime + '&batchNumber=' + data.batchNumber
	return api.post(url, data)
}


// 导入excel其他 导出
export const exportInvoiceReconciliation = (data) => {
	const url = '/vapi/excel/export/exportInvoiceReconciliation'
	return api.download(url, data)
}


//导入excel其他个人查询
export const selInvoiceReconciliationToManagerName = (data) => {
	const url = '/vapi/excel/export/selInvoiceReconciliationToManagerName?pageNum=' + data.pageNum + '&pageSize=' +
		data.pageSize + '&orderNo=' + data.orderNo + '&invoiceTaker=' + data.invoiceTaker + '&managerName=' + data
		.managerName + '&sku=' + data.sku + '&createTime=' + data.createTime + '&batchNumber=' + data.batchNumber
	return api.post(url, data)
}


// 导入excel其他个人 导出
export const exportInvoiceReconciliationToManagerName = (data) => {
	const url = '/vapi/excel/export/exportInvoiceReconciliationToManagerName'
	return api.download(url, data)
}



// 经理人查询列表
export const sqlInvoiceTaker = (data) => {
	const url = '/vapi/excel/selDictionary/sqlInvoiceTaker'
	return api.get(url, data)
}

// 收票人查询列表
export const sqlManagerName = (data) => {
	const url = '/vapi/excel/selDictionary/sqlManagerName'
	return api.get(url, data)
}


//项目经理导出zip
export const downloadZip = (data) => {
	const url = '/vapi/ofdparser/ofd/downloadZip'
	return api.download(url, data)
}

// 对账发票主项导入模板下载
export const downloadInvoiceZhi = (data) => {
	const url = '/vapi/file/downloadInvoiceZhi'
	return api.download(url, data)
}
// 对账发票子项导入模板下载
export const downloadInvoiceZhu = (data) => {
	const url = '/vapi/file/downloadInvoiceZhu'
	return api.download(url, data)
}

// 单个导出
export const exportInvoiceToOrderNo = (data) => {
	const url = '/vapi/excel/export/exportInvoiceToOrderNo'
	return api.download(url, data)
}


// 解析发票
export const sortingList = (data) => {
	const url = '/vapi/ofdparser/ofd/sortingList'
	return api.get(url, data)
}

// 批量处理
export const upHandle = (data) => {
	const url = '/vapi/excel/import/upHandle?ids=' + data.ids + '&handle=' + data.handle
	return api.post(url, data)
}
// 批量导出
export const exportInvoiceToOrderNoBatch = (data) => {
	const url = '/vapi/excel/export/exportInvoiceToOrderNoBatch'
	return api.download(url, data)
}


// 时间下拉
export const sqlHandleTime = (data) => {
	const url = '/vapi/excel/selDictionary/sqlHandleTime'
	return api.get(url, data)
}


//组织查询

//分类查询带图片
export const getAllOrgList = () => {
	const url = `/special/purchaserOrg/all`
	return api.get(url)
}

// 获取采购分支下拉列表
export const selOrgByUserId = () => {
	const url = '/vapi/shoporder/selOrgByUserId'
	return api.get(url)
}


// 查询埋点日志
export const selectBuriedPoint = (param) => {
	const url = '/special/dictionary/TBuriedPoint/selectBuriedPoint'
	return api.get(url, param)
}


//供应商发起对账（本地供应商）
export const findOrderCanReconciliation = (data) => {
	const url =
		`${config.pre}/reconciliation/reconciliationSupplier/admin/adminOrderList?pageNum=${data.pageNum}&pageSize=${data.pageSize}`
	return api.get(url, data)
}

//供应商发起对账（本地供应商）
export const findOrderDoReconciliation = (data) => {
	const url = `${config.pre}/reconciliation/reconciliationSupplier/apply`
	return api.post(url, data)
}

export const supplierList = () => {
	const url = `${config.pre}/reconciliation/reconciliationSupplier/admin/supplierList`
	return api.get(url)
}





// 采购组织下拉用户加价模板
export const selManagerForPurchase = (data) => {
	// const url = '/vapi/shoporder/selManagerForPurchase'
	const url = '/vapi/shoporder/selPurchase'
	return api.post(url, data)
}


// 加价模板选择同组织人员(加价)
export const selOrderManagementDiscount = (data) => {
	// const url = '/vapi/shoporder/selUserAllUserForDiscount'
	const url = '/vapi/shoporder/selOrderManagementDiscountQ'
	return api.post(url, data)
}

// 加价模板选择同组织人员(停用)
export const selUserAllUserForDeactivates = (data) => {
	// const url = '/vapi/shoporder/selUserAllUserForDeactivates'
	const url = '/vapi/shoporder/selUserAllUserForDeactivates'
	return api.post(url, data)
}

// 加价模板停用
export const delOrderDeactivate = (data) => {
	const url = '/vapi/shoporder/delOrderDeactivate'
	return api.post(url, data)
}

// 加价模板选择同组织人员
export const selUserAllUserForDiscount = (data) => {
	const url = '/vapi/shoporder/selUserAllUserForDiscount'
	return api.post(url, data)
}

// 采购组织加价查询
export const selOrderDeactivate = (data) => {
	const url = '/vapi/shoporder/selOrderDeactivateQ?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize
	return api.post(url, data)
}


// 认领发票抬头下拉
export const selInvoiceHeaderToReceive = (data) => {
	const url = '/vapi/reconciliation/reconciliationManager/selInvoiceHeaderToReceive'
	return api.post(url, data)
}

//认领页面查询
export const selInvoiceClaim = (data) => {
	const url = '/vapi/reconciliation/reconciliationInvoice/selInvoiceClaim?pageNum=' + data.pageNum +
		'&pageSize=' + data.pageSize
	return api.post(url, data)
}

// 认领发票导出
export const exportInvoiceClaim = (data) => {
	const url = '/vapi/reconciliation/reconciliationInvoice/exportInvoiceClaim'
	return api.postDownload(url, data)
}


// 认领导入模板下载
export const downloadInvoiceClaim = (data) => {
	const url = '/vapi/file/downloadInvoiceClaim'
	return api.download(url, data)
}

//认领页面修改状态
export const upInvoiceClaim = (data) => {
	const url = '/vapi/reconciliation/reconciliationInvoice/upInvoiceClaim'
	return api.post(url, data)
}

//无头单查询（带分页）
export const errOrder = (data) => {
	const url = '/vapi/reconciliation/reconciliationSupplier/errOrder?pageNum=' + data.pageNum + '&pageSize=' + data
		.pageSize
	return api.post(url, data)
}

//无头单发票抬头下拉
export const invoicesList = (data) => {
	const url = '/vapi/reconciliation/reconciliationSupplier/invoicesList'
	return api.get(url, data)
}

//给无头单分配项目经理
export const pairOrder = (data) => {
	const url = '/vapi/reconciliation/reconciliationSupplier/pairOrder'
	return api.get(url, data)
}
//财务待开票查询发票抬头下拉
export const selFinanceInvoiceHeader = (data) => {
	const url = '/vapi/reconciliation/reconciliationManager/selFinanceInvoiceHeader'
	return api.post(url, data)
}
// 查询进出项票
export const selInvoiceHistory = (data) => {
	const url = '/vapi/reconciliation/reconciliationInvoice/selInvoiceHistory?pageNum=' + data.pageNum +
		'&pageSize=' + data.pageSize
	return api.post(url, data)
}
// 进票确认取消
export const upInvoiceHistoryIn = (data) => {
	const url = '/vapi/reconciliation/reconciliationInvoice/upInvoiceHistoryIn'
	return api.post(url, data)
}

// 出票确认取消
export const upInvoiceHistoryOut = (data) => {
	const url = '/vapi/reconciliation/reconciliationInvoice/upInvoiceHistoryOut'
	return api.post(url, data)
}

// 认领导入模板下载
export const downloadInvoiceHistory = (data) => {
	const url = '/vapi/file/downloadInvoiceHistory'
	return api.download(url,data)
}

//轮播图查询
export const selectTBannerList = (data) => {
	const url = '/special/dictionary/banner/list'
	return api.get(url,data)
}

//轮播图新增
export const addBanner = (data) => {
	const url = '/special/dictionary/banner/save'
	return api.post(url,data)
}

//轮播图修改
export const editBanner = (data) => {
	const url = '/special/dictionary/banner/edit'
	return api.put(url,data)
}


//轮播图删除
export const deleteBanner = (data) => {
	const url = '/special/dictionary/banner/delfalse'
	return api.put(url,data)
}


//公告左下查询
export const selecleftBottomAd = (data) => {
	const url = '/special/dictionary/leftBottomAd/selecleftBottomAd'
	return api.get(url,data)
}

//公告左下新增
export const inserleftBottomAd = (data) => {
	const url = '/special/dictionary/leftBottomAd/inserleftBottomAd'
	return api.post(url,data)
}
//公告左下修改
export const edileftBottomAd = (data) => {
	const url = '/special/dictionary/leftBottomAd/edileftBottomAd'
	return api.put(url,data)
}

// 用户修改身份
export const editUserType = (data) => {
	const url = '/special/dictionary/users/editUserType'
	return api.post(url, data)
}

//查询用户身份信息
export const selectTypeByUserId = (data) => {
	const url = '/special/dictionary/users/selectTypeByUserId'
	return api.post(url, data)
}



// 用户修改身份
export const editSpByOrgId = (data) => {
	const url = '/special/dictionary/org/editSpByOrgId'
	return api.post(url, data)
}

//查询用户身份信息
export const selectSpByOrgId = (data) => {
	const url = '/special/dictionary/org/selectSpByOrgId'
	return api.post(url, data)
}



//注册

export const insertTUser = (data) => {
	const url = '/special/dictionary/users/insertTUser'
	return api.post(url, data)
}


//完善信息
export const insertTBizUserPurchase = (data) => {
	const url = '/special/dictionary/users/insertTBizUserPurchase'
	return api.post(url, data)
}


//查询供应商 HZR
export const selectSupplierList = (data) => {
	var url = ""
	debugger
	if(data.pageNum && data.pageSize){
		url = '/special/dictionary/org/selectSupplierList?pageNum='+data.pageNum+'&pageSize='+data.pageSize
	}else{
		url = '/special/dictionary/org/selectSupplierList'
	}
	return api.post(url, data)
}

//查询注册审核清空
export const selectTBizUserPurchaseList = (data) => {
	var url = ""
	if(data.pageNum && data.pageSize){
		url = '/special/dictionary/users/selectTBizUserPurchaseList?pageNum='+data.pageNum+'&pageSize='+data.pageSize
	}else{
		url = '/special/dictionary/users/selectTBizUserPurchaseList'
	}
	return api.post(url, data)
}

// 查询用户注册信息  组织
export const selectTAuthUserOrg = (data) => {
	const url = '/special/dictionary/users/selectTAuthUserOrg'
	return api.post(url, data)
}

//查询注册审核清空
export const updateTBizUserPurchase = (data) => {
	const url = '/special/dictionary/users/updateTBizUserPurchase'
	return api.post(url, data)
}
//采购人审批未通过修改
export const updateRefuseDetail = (data) => {
	const url = '/special/dictionary/users/updateRefuseDetail'
	return api.post(url, data)
}
//供应商审批未通过修改
export const updateSupplierRefuseDetail = (data) => {
	const url = '/special/dictionary/users/updateSupplierRefuseDetail'
	return api.post(url, data)
}
// 查询用户授权列表
export const getMenuList = () => {
	const url = `/special/dictionary/authmenu/getMenuList/`
	return api.get(url)
}


// 插入用户授权菜单
export const insertAuthMenu = (data) => {
	const url = `/special/dictionary/authmenu/insertAuthMenu/`
	return api.post(url,data)
}
// 插入用户授权菜单
export const editAuthMenu = (data) => {
	const url = `/special/dictionary/authmenu/editAuthMenu/`
	return api.post(url,data)
}
// 插入用户授权菜单
export const deleteAuthMenuById = (data) => {
	const url = `/special/dictionary/authmenu/deleteAuthMenuById/`
	return api.post(url,data)
}



// 插入用户授权菜单
export const selectOrgByUserId = (userId) => {
	const url = `/special/dictionary/users/selectOrgByUserId?UserId=`+userId
	return api.get(url)
}
// 根据用户ID查询用户信息
export const selectUserInfoByUserId = (data) => {
	const url = `/special/dictionary/users/selectUserInfoByUserId`
	return api.post(url,data)
}
//组织新增
export const insertOrg = (data) => {
	const url = `/special/dictionary/org/insertOrg`
	return api.post(url,data)
}
//组织修改
export const updateOrg = (data) => {
	const url = `/special/dictionary/org/updateOrg`
	return api.post(url,data)
}
//组织删除
export const deleteTOrgById = (data) => {
	const url = `/special/dictionary/org/deleteTOrgById`
	return api.post(url,data)
}


//用户新增
export const insertUser = (data) => {
	const url = `/special/dictionary/users/insertTUser`
	return api.post(url,data)
}
//用户编辑
export const editUser = (data) => {
	const url = `/special/dictionary/users/updateTUser`
	return api.post(url,data)
}

//用户删除
export const deleteTUser = (data) => {
	const url = `/special/dictionary/users/deleteTUser`
	return api.post(url,data)
}

// 查询pscs电文信息
export const pscsLogMapper = (data) => {
	const url = `/vapi/wbservice/PscsChaXun/getpscsLogMapper`
	return api.post(url,data)
}

//查询角色资源
export const selRoleResource = (data) => {
	const url = `/special/dictionary/roleSet/selRoleResource`
	return api.post(url,data)
}

//新增用户预算
export const insertBudgetByUser = (data) => {
	debugger
	const url = `/special/dictionary/purchaseBudget/insert`
	return api.post(url,data)
}

//修改用户预算
export const updateBudgetByUser = (data) => {
	debugger
	const url = `/special/dictionary/purchaseBudget/update`
	return api.post(url,data)
}



